package com.sloera.spring.beans.annotation;

import com.sloera.spring.beans.annotation.controller.UserController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author sloera
 * @create 2020/4/6
 */
public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-context.xml");
        //TestObject to = (TestObject) ctx.getBean("testObject");
        //System.out.println(to);
        UserController userController = (UserController) ctx.getBean("userController");
        System.out.println(userController);
        userController.execute();
        //UserRepository userRepository = (UserRepository)ctx.getBean("userRepository");
        //System.out.println(userRepository);
        //UserService userService = (UserService) ctx.getBean("userService");
        //System.out.println(userService);
    }
}
